﻿Imports ginkyo.AdvancedApi.WPFApplication
Imports Tunlr.MainModel
Imports Tunlr.TaskbarInfo

Public Class StatusWindow

    Private Sub StatusWindow_Activated(sender As Object, e As EventArgs) Handles Me.Activated

        Dim _taskbarInfo As TASKBARDATA = GetTaskbarInfo()
        Dim _Position As New Point
        Select Case _taskbarInfo.uEdge
            Case Position.Bottom
                _Position.Y = (_taskbarInfo.rc.top - 10) - Me.Height
                _Position.X = (_taskbarInfo.rc.right - 15) - Me.Width

            Case Position.Top
                _Position.Y = (_taskbarInfo.rc.bottom + 10)
                _Position.X = (_taskbarInfo.rc.right - 15) - Me.Width

            Case Position.Left
                _Position.Y = (_taskbarInfo.rc.bottom - 10) - Me.Height
                _Position.X = (_taskbarInfo.rc.right + 15)

            Case Position.Right
                _Position.Y = (_taskbarInfo.rc.bottom - 10) - Me.Height
                _Position.X = (_taskbarInfo.rc.left - 15) - Me.Width
        End Select


        Me.Top = _Position.Y
        Me.Left = _Position.X

    End Sub

    Private Sub StatusWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
        Me.DataContext = Application._MainViewModel
    End Sub

End Class
